This invention is particularly useful in the coding of still and moving pictures at very high compression. It is suitable for use in video conferencing applications over standard telephone lines as well as for other applications that require high compression.
In most compression algorithms some form of loss in the decoded picture is expected. A typical method for compression that produces good results is to introduce this loss by quantizing the signal in the transform domain instead of the pixel domain. Examples of such transforms are the Discrete Cosine Transform, DCT, the wavelet transforms and the subband analysis filters. In a transform based compression algorithm, the picture is converted into the transform domain and a quantization scheme is applied to the coefficients to reduce the amount of information. The transformation has the effect of concentrating the energy into a few coefficients and noise can be introduced into these coefficients without affecting the perceived visual quality of the reconstructed picture.
It is well known that some form of human visual perception system with different weighting on the quantization on different coefficients can improve the perceived visual quality. In coding standards such as the ISO/IEC JTC1/SC29/WG11 IS-13818-2(MPEG2), the quantization of the DCT coefficients are weighted by the quantization matrix. A default matrix is normally used however the encoder can choose to send new values of the quantization matrix to the decoder. This is done through the signaling in the bitstream header.
The prior art on sending Quantization Matrix based on the MPEG-2 video standard, is to send 64 fixed values of 8-bit each if the bit signaling for using a special Quantization Matrix is set to xe2x80x9c1xe2x80x9d.
The values of the matrix in the position of higher frequency band are actually not used, especially for very low bit rate coding where a large quantization step is employed, or for an input block with very plain texture or with good motion compensation.
It is also found that, in the above prior art, for any of Quantization Matrix used in different applications, the first value of quantization matrix is always set to eight, no matter whether it is low bit rate coding or high bit rate coding.
One problem with this method is the amount of information that need to be sent as part of the quantization matrix. In a typical case all 64 coefficients each of 8 bits are required. This represents a total of 512 bits. If three different Quantization Matrices are required for three bands of colour information, then the total bits will be three times of that amount. This represents too much overhead for low bit rate transmissions. It results in too long a set up time or latency in the transmissions should the matrix be changed in the middle of the transmission.
The second problem to be solved is the spatial masking of the human visual system. Noise in flat regions are more visible than noise in textured regions. Therefore applying the same matrix to all regions is not a good solution as the matrix is globally optimized but not locally adjusted to the activity of the local regions.
The third problem to be solved is the bit saving from the variable quantization matrix value for DC. The first value in Quantization matrix is decreased for higher bit rate and flat region and increased for lower bit rate and textured region.
To solve the above problem to reduce the transmission data, an encoding method for encoding a quantization matrix for still and moving picture, according to the present invention, comprises:
holding a default quantization matrix including a plurality of quantization elements having predetermined values;
generating a particular quantization matrix including a plurality of quantization elements having selected values;
reading said particular quantization matrix in a predetermined zigzag pattern;
terminating the reading of the particular quantization matrix at a selected position while reading in the predetermined zigzag pattern, and producing a former portion of the particular quantization matrix;
adding an end code after the quantization elements of said former portion of the particular quantization matrix;
reading said default quantization matrix in said predetermined zigzag pattern from a position immediately after said selected position, and producing a latter portion of the default quantization matrix; and
synthesizing said former portion of the particular quantization matrix and said latter portion of the default quantization matrix to form a synthesized quantization matrix.
According to the present invention, a decoding method for decoding a quantization matrix for still and moving picture comprises:
holding a default quantization matrix including a plurality of quantization elements having predetermined values;
receiving a number of quantization elements and an end code;
positioning said received quantization elements in a predetermined zigzag pattern to form a former portion, and terminating the positioning of the received quantization elements upon detection of said end code;
reading said default quantization matrix in said predetermined zigzag pattern from a position immediately after said former portion, and forming a latter portion with quantization elements from the default quantization matrix; and
synthesizing said former portion of the particular quantization matrix and said latter portion of the default quantization matrix to form a synthesized quantization matrix.
According to the present invention an encoder for encoding a quantization matrix for still and moving picture comprises:
a holding member which holds a default quantization matrix including a plurality of quantization elements having predetermined values;
a generating member which generates a particular quantization matrix including a plurality of quantization elements having selected values;
a reading member which reads said particular quantization matrix in a predetermined zigzag pattern;
a terminating member which terminates the reading of the particular quantization matrix at a selected position while reading in the predetermined zigzag pattern, and producing a former portion of the particular quantization matrix;
an adding member which adds an end code after the quantization elements of said former portion of the particular quantization matrix;
a reading member which reads said default quantization matrix in said predetermined zigzag pattern from a position immediately after said selected position, and producing a latter portion of the default quantization matrix; and
a synthesizing member which synthesizes said former portion of the particular quantization matrix and said latter portion of the default quantization matrix to form a synthesized quantization matrix.
According to the present invention, a decoder for decoding a quantization matrix for still and moving picture comprises:
a holding member which holds a default quantization matrix including a plurality of quantization elements having predetermined values;
a receiving member which receives a number of quantization elements and an end code;
a positioning member which positions said received quantization elements in a predetermined zigzag pattern to form a former portion, and terminating the positioning of the received quantization elements upon detection of said end code;
a reading member which reads said default quantization matrix in said predetermined zigzag pattern from a position immediately after said former portion, and forming a latter portion with quantization elements from the default quantization matrix; and
a synthesizing member which synthesizes said former portion of the particular quantization matrix and said latter portion of the default quantization matrix to form a synthesized quantization matrix.
A further problems are solved by the following means.
A default matrix is designed to allow a variable number of weights to be updated by the encoder. This method of adjusting the matrix to the picture content at different degrees is hereafter referred to as truncated quantization matrix.
This truncated quantization matrix can be decided by checking coding bit rate, complexity of coded picture, as well as other aspects. It always requires a small number of non-zero values which are normally concentrated on the DC and the first few AC coefficients, especially in low bit rate coding. Furthermore these non-zero values can be coded differentially, and less than 8-bit for each value will be used to code the difference values.
The quantization weights are scaled according to the activity of the block.
The quantization weights are scaled according to the quantization step size of the block.
The present invention provides a method to increase the efficiency of using quantization matrix from both bit saving and adaptation to individual blocks.
Quantization matrix is decided based on different coding bit rate, as well as other aspects in this way: only the first few values in quantization matrix are set to non-zero with certain weighting, and others are truncated to zero, which are not coded and transmitted.
This truncated quantization matrix is scanned by zig-zag or other ways, differentially coded and transmitted, together with the number of the non-zero values, or terminated by specific symbol.
The weighting scale can be adjusted by checking the number of coefficients left after quantization, since the number of coefficients left can reflect the activity of the block. If only DC coefficient is left after quantization, then the weighting scale for DC should be smaller or equal to 8 because it is flat region, otherwise if a lot of AC coefficients are left, the weighting scale for DC can be larger, for example two times of quantization step. The same adjustment can be done for the weighting scale for AC coefficients.